#include <iostream>
using namespace std;

#define NOT_FOUND -1

//顺序查找
template <typename E>
int Search(E a[], int n, E x)
{
    for(int i = 0; i < n; i++)
        if(a[i] == x)
            return i;
    return NOT_FOUND;
}

int main()
{
    int a[] = {3,1,4,1,5,9,2,6,5,3};
    cout << Search(a, 10, 4) << endl;
    cout << Search(a, 10, 1) << endl;
    cout << Search(a, 10, 8) << endl;

    return 0;
}